theme development

您所在的位置:网站首页 front page vs home page wordpressorg theme development

theme development

2023-03-08 11:46| 来源: 网络整理| 查看: 265

is_front_page() returns true if the user is on the page or page of posts that is set to the front page on Settings->Reading->Your homepage displays

So if you set about us as the front page then this conditional will only be true if showing the about us page.

is_home() return true when on the posts list page, This is usually the page that shows the latest 10 posts.

If the settings under Your homepage displays are left at default then the home page will return true for both is_front_page() and is_home()

An example of using is_home():

You have set your posts page to a page called News. A user navigates there and in the header you want to show additional navigation You could use is_home() to do this.


【本文地址】


今日新闻


推荐新闻


CopyRight 2018-2019 办公设备维修网 版权所有 豫ICP备15022753号-3